package com.project.systemfront.controller;


import com.project.systemfront.common.Result;
import com.project.systemfront.pojo.PhotographerProfile;
import com.project.systemfront.pojo.vo.profileVo;
import com.project.systemfront.service.IPhotographerProfileService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;


import java.util.List;

@RestController
@RequestMapping("/system/profile")
public class PhotographerProfileController
{
    @Autowired
    private IPhotographerProfileService profileService;

    @GetMapping
    public Result<List<profileVo>> getList()
    {
        PhotographerProfile profile = new PhotographerProfile();
        profile.setStatus(1L);
        List<profileVo> list = profileService.selectPhotographerProfileList(profile);
        return Result.success(list);
    }

    @GetMapping("/{id}")
    public Result<List<profileVo>> getProfile(@PathVariable Long id)
    {
        PhotographerProfile profile = new PhotographerProfile();
        profile.setId(id);
        List<profileVo> list = profileService.selectPhotographerProfileList(profile);
        return Result.success(list);
    }
}
